#include "list.hh"

#include <cstdlib>
#include <iostream>
//#include <boost/test/minimal.hpp>

#define ASSERT_EQUAL(got, expected)                                   \
    do {                                                              \
        if (got != expected) {                                        \
            std::cout << __LINE__ << ": got " << got << ", expected " \
                      << expected << std::endl;                       \
            std::exit(-1);                                            \
        }                                                             \
    } while (0)

void test_push_back()
{
    tinystl::list<int> aList;
    for (int i = 1; i <= 100; i++) {
        aList.push_back(i);
    }
}

int main()
{
    tinystl::list<int> list1;

    ASSERT_EQUAL(list1.empty(), true);
    ASSERT_EQUAL(list1.size(), 0);

#if 1

    for (int i = 1; i <= 100; i++) {
        list1.push_back(i);
        ASSERT_EQUAL(list1.back(), i);
    }

    for (int i = 1; i <= 100; i++) {
        ASSERT_EQUAL(list1.front(), i);
        list1.pop_front();
    }

    ASSERT_EQUAL(list1.empty(), true);
    ASSERT_EQUAL(list1.size(), 0);

#endif
    return 0;
}
